#include <stdio.h>
#include <libavformat/avformat.h>

AVOutputFormat *pOutputFormat;
char *outfilename = "/tmp/test.ts";

/*
 * 参考网址: http://topic.csdn.net/u/20111230/10/499578c6-77fc-4bbf-b098-4796247360fd.html
 */

int main(void)
{
		av_register_all();

		// auto detect the output format from the name. default is mpeg.  
		pOutputFormat = av_guess_format(NULL, outfilename, NULL);
		if (pOutputFormat == NULL)
		{
				printf("guess error\n");
				return;
		}

		printf("guest successful\n");	
		printf("pOutputFormat->video_codec=%d\n", pOutputFormat->video_codec);
}
